//引入模块
const newSession = require('./newSession/index');
const sendMsg = require('./sendMsg/index');
const leaveSession = require('./leaveSession/index');
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()
  switch (event.type) {
    case 'newSession': 
      return await newSession.main(event, context);
    case 'sendMsg': 
      return await sendMsg.main(event, context);
    case 'leaveSession': 
      return await leaveSession.main(event, context);
  }
}